<?php
/**
 * SocialEngine
 *
 * @category   Application_Extensions
 * @package    Sitepage
 * @copyright  Copyright 2010-2011 BigStep Technologies Pvt. Ltd.
 * @license    http://www.socialengineaddons.com/license/
 * @version    $Id: activity-feed.tpl 2011-05-05 9:40:21Z SocialEngineAddOns $
 * @author     SocialEngineAddOns
 */
?>

<h2><?php echo $this->translate('Directory / Pages Plugin'); ?></h2>
<?php if (count($this->navigation)): ?>
  <div class='sitepage_admin_tabs'>
  <?php
  // Render the menu
  //->setUlClass()
  echo $this->navigation()->menu()->setContainer($this->navigation)->render()
  ?>
</div>
<?php endif; ?>



  <div class='clear sitepage_settings_form'>
    <div class='settings'>
    <?php echo $this->form->render($this); ?>
  </div>
</div>
<script type="text/javascript">
  function faq_show(id) {
    if($(id).style.display == 'block') {
      $(id).style.display = 'none';
    } else {
      $(id).style.display = 'block';
    }
  }
  window.addEvent('domready', function() {
    showEditingOptions("sitepagefeed_type_dummy-wrapper",'<?php echo Engine_Api::_()->getApi('settings', 'core')->getSetting('sitepage.feed.type', 0); ?>');
    showEditingOptions("sitepagefeed_likepage_dummy-wrapper",'<?php echo Engine_Api::_()->getApi('settings', 'core')->getSetting('sitepage.feed.likepage', 0); ?>');
    showEditingOptions("sitepagefeed_everyone_dummy-wrapper",'<?php echo Engine_Api::_()->getApi('settings', 'core')->getSetting('sitepage.feed.everyone', 0); ?>');
    var feedTypeVale='<?php echo Engine_Api::_()->getApi('settings', 'core')->getSetting('sitepagefeed.type.dummy', 'c') ?>';
    if(feedTypeVale=='a'){
      showTips('tip_feed_widget','feed');
    }else if(feedTypeVale=='b' || feedTypeVale=='c'){
      showTips('tip_feed_faq','feed');
      if(feedTypeVale=='c' && $('faq_38'))
         $('faq_38').style.display = 'block';
    }
    var feedTypeVale='<?php echo Engine_Api::_()->getApi('settings', 'core')->getSetting('sitepagefeed.likepage.dummy', 'c') ?>';
    if(feedTypeVale=='a'){
      showTips('tip_like_widget','like');
    }else if(feedTypeVale=='b' || feedTypeVale=='c'){
      showTips('tip_like_faq','like');
        if(feedTypeVale=='c' && $('faq_37'))
         $('faq_37').style.display = 'block';
    }

    var feedTypeVale='<?php echo Engine_Api::_()->getApi('settings', 'core')->getSetting('sitepagefeed.everyone.dummy', 'c') ?>';
    if(feedTypeVale=='a'){
      showTips('tip_everyone_widget','everyone');
    }else if(feedTypeVale=='b' || feedTypeVale=='c'){
      showTips('tip_everyone_faq','everyone');
        if(feedTypeVale=='c' && $('faq_59'))
         $('faq_59').style.display = 'block';
    }
  });
  function showEditingOptions(id,value) {
    if($(id)) {
      if(value==0)
        $(id).style.display = 'none';
      else
        $(id).style.display = 'block';
    }
  }

  function showTips(id,type){
    if($(id)) {
      if(type=='feed'){
        $('faq_38').style.display = 'none';
        $('tip_feed_widget').style.display = 'none';
        $('tip_feed_faq').style.display = 'none';
        $(id).style.display = 'block';
      }
      if(type=='like'){
        $('faq_37').style.display = 'none';
        $('tip_like_widget').style.display = 'none';
        $('tip_like_faq').style.display = 'none';
        $(id).style.display = 'block';
      }
      if(type=='everyone'){
        $('faq_59').style.display = 'none';
        $('tip_everyone_widget').style.display = 'none';
        $('tip_everyone_faq').style.display = 'none';
        $(id).style.display = 'block';
      }
    }
  }


  function openSmoothboxFeed(url){
   
    var feedType='<?php echo Engine_Api::_()->getApi('settings', 'core')->getSetting('sitepage.feed.type', 0); ?>';
    var likedPage='<?php echo Engine_Api::_()->getApi('settings', 'core')->getSetting('sitepage.feed.likepage', 0); ?>';
    var everyOne='<?php echo Engine_Api::_()->getApi('settings', 'core')->getSetting('sitepage.feed.everyone', 0); ?>';
    if($('sitepage_feed_type-wrapper')){
      if($('sitepage_feed_type-1').checked){
        feedType=1;
      }else{
        feedType=0;
      }
    }
    if($('sitepage_feed_likepage-wrapper')){     
      if($('sitepage_feed_likepage-1').checked){
        likedPage=1;
      }else{
        likedPage=0;
      }
    }
    if($('sitepage_feed_everyone-wrapper')){      
      if($('sitepage_feed_everyone-1').checked){
        everyOne=1;
      }else{
        everyOne=0;
      }
    }
    url=url+'/feedType/'+feedType+'/likedPage/'+likedPage+'/everyOne/'+everyOne;
    Smoothbox.open( url);

  }
</script>
